package com.xjm.entity.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * <p>
 *
 * </p>
 *
 * @author xjm
 * @since 2025-03-03
 */
@Data
@TableName("order_items")
public class OrderItemsModel implements Serializable {


    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private Integer orderId;

    private Integer productId;

    /**
     * 商品名称快照
     */
    private String productName;

    /**
     * 商品图片快照
     */
    private String productImage;

    /**
     * 购买时价格
     */
    private BigDecimal price;

    private Integer quantity;

    /**
     * 是否已评价
     */
    private Byte isReviewed;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.UPDATE)
    private Date updatedTime;
}
